﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class LichSuGiaoDich : System.Web.UI.Page
{
    private DataSet objDataSet;
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            BindGrid();
        }
    }

    public void BindGrid()
    {
        // how many orders to list?
        int recordCount;
        // load the new data into the grid
        DonDatHangBUS objOrder = new DonDatHangBUS(TGDDConfiguration.DbConnectionString);
        Guid userId = new Guid(Session["g_UserId"].ToString());
        objDataSet = objOrder.LichSuGiaoDich(userId);
        grid.DataSource = objDataSet.Tables[0];
        grid.DataBind();
    }
    protected void grid_SelectedIndexChanged(object sender, EventArgs e)
    {
        // Save the ID of the selected order in the session
        Session["AdminOrderID"] = grid.DataKeys[grid.SelectedIndex].Value.ToString();
    }
}
